code = input()
count = 0
current = code[0]
encoded = ''
for i in code:
    if i == current:
        count += 1
    else:
        encoded += current + str(count)
        current = i
        count = 1
print (encoded + current + str(count))